
/**
 * @Project : Clion_ProgrammingExercises
 * @File : 1
 * @Author : WangRuoyu 
 * @Date : 2023/5/12 16:22
 */

#include "iostream"
#include "cstring"
#include "algorithm"

using namespace std;

int main() {
    int n;
    cin >> n;
    int res = 0;
    while (n != 0) {
        res += n % 10;
        n /= 10;
    }
    cout << res;
    return 0;
}